//
//  PushTwoViewController.m
//  06-UINavigationController
//
//  Created by dllo on 16/7/21.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "PushTwoViewController.h"

@interface PushTwoViewController ()

@end

@implementation PushTwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
    btn.frame = CGRectMake(100, 100, 100, 100);
    btn.backgroundColor = [UIColor blueColor];
    [self.view  addSubview:btn];
    [btn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)clickBtn:(UIButton *)btn {
    // pop当前ViewController出栈, 返回上一级视图控制器
    [self.navigationController popViewControllerAnimated:YES];
    // 返回根视图
    // [self.navigationController popToRootViewControllerAnimated:YES];
    // 返回栈中指定的视图控制器
    // [self.navigationController popToViewController:<#(nonnull UIViewController *)#> animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
